'''
Created on Nov 25, 2010

@author: philip
'''
from models import Tip

class AddTipRequest:
    def __init__(self,community,content):
        self.community = community
        self.content = content

class TipService:
    def __init__(self):
        pass
    
    def getTips4Community(self,community):
        return Tip.objects.filter(communityId=community)
    
    def addTip(self,request):
        t = Tip()
        t.communityId = request.community
        t.content = request.content
        t.save()
        return t